<?php 

require_once 'C:\phpstudy_pro\WWW\cscs.qumei.com\weizanZB\林西项目\api\function.php';
session_start();

if($_POST['type']!=='login'){

	if(count($_SESSION)==0){

			$res=[

				'code'=>300,
				'msg'=>'当前未登录',
				
			];

			echo json_encode($res,JSON_UNESCAPED_UNICODE);

			return;

	}

}
if($_SERVER['REQUEST_METHOD'] == 'GET'){

	switch ($_GET['type']) {
		case 'data':
			echo getDateAll($_GET['userLevel']);
			break;
		case 'baobiao':
			echo getBaobiao($_GET['starDate'],$_GET['endDate']);
			break;
		case 'dateBiao':
			echo getriqiBaobiao($_GET['starDate'],$_GET['endDate']);
			break;
		case 'dataLevel':
			echo getLevelDateAll();
			break;
		case 'testMongoDB':
			testMongoDB();
			break;
		case 'aggregate':
			echo aggregate();
			break;
		case 'getDateAllMySql':
			echo getDateAllMySql();
			break;
		case 'getABku':
			echo getABku();
			break;
		case 'getbyRemark':
			echo getbyRemark();
			break;
		case 'importExcel':
			importExcel();
			break;
		case 'getYunWei':
			echo getYunWei();
			break;
		case 'insertCustomer_yunweinames':
			echo insertCustomer_yunweinames();
			break;
		case 'getKeFunFenPeiTable': //获取客服分表客资表
			echo getKeFunFenPeiTable();
			break;
		case 'loginYanZheng': //登录验证
			loginYanZheng();
			break;
		case 'loginZhuXiao': //登录注销
			loginZhuXiao();
			break;
		case 'updata_customer_yunweinames_status':
			echo updata_customer_yunweinames_status();
			break;
		case 'getdetail':
			getdetail();
			break;
		case 'getYunWeiFenPeiCount':
			echo getYunWeiFenPeiCount();
			break;
		case 'getKeFuFenPeiTable': //获取客服转单情况明细
			echo getKeFuFenPeiTable();
			break;
		case 'getKeFuFenPeiCount'://获取客服转单情况计数
			echo getKeFuFenPeiCount();
			break;
		case 'getKeFuFenPeiDatilTable': //获取客服单人派单明细情况
			echo getKeFuFenPeiDatilTable();
			break;
		case 'pass':
			echo pass(); // 将不合格的客资转变为合格的客资功能
			break;
		case 'updata_yidu':
			echo updata_yidu();//只更客资的状态接口
			break;
		default:
			echo '请求参数不正确';
			break;
	}


}else if($_SERVER['REQUEST_METHOD'] == 'POST'){



	switch ($_POST['type']) {
		case 'importExcel':
			importExcel($_POST['data']);
			break;
		case 'login':
			login();
			break;
		default:
			echo '请求参数不正确';
			break;
	}
}


?>


